// import { ResPage, User } from "@/api/interface/index";
// import { PORT1 } from "@/api/config/servicePort";

import http from "@/api";
import Qs from 'qs'; 

const { APP_USER_URL } = window.config;

/**
 * @name 用户管理模块
 */

// 登录
export const login = (params) => {
	return http.post(`${APP_USER_URL}/userLogin/login`, params);
};

// 退出登录
export const logout = (params) => {
    return http.post(`${APP_USER_URL}/userLogin/logout`, params);
}; 
 
// 发送验证码
export const sendSmsSign = (params) => {
	return http.post(`${APP_USER_URL}/userLogin/sendSmsSign`, Qs.stringify(params));
};

// 根据token获取已登陆用户信息
export const getLoginedUserInfo = (params) => {
	return http.post(`${APP_USER_URL}/userLogin/jumpLogin`, Qs.stringify(params));
};

// 检查当前地址是否登陆
export const checkLogin = (params) => {
	return http.post(`${APP_USER_URL}/userLogin/checkLogin`, Qs.stringify(params));
};

// 更新密码
export const updatePassword = (params) => {
    return http.post(`${APP_USER_URL}/user/updatePassword`, Qs.stringify(params));
};

// 获取组织列表
export const getOrganizationList = (params) => {
    return http.post(`${APP_USER_URL}/org/getOrganizationList`, params);
};

// 获取矿区列表
export const getMineList = (params) => {
    return http.post(`${APP_USER_URL}/orgTree/selectOrgList`, params);
};

// 获取用户权限
export const getAuthority = (params) => {
    return http.post(`${APP_USER_URL}/permission/getPermissionByLogin`, Qs.stringify(params));
};
